package top.wfzzq.dp.Singleton;

public class Demo {
      public static void main(String[] args) {
		Singleton s1=Singleton.getInstance();
		Singleton s2=Singleton.getInstance();
		System.out.println(s1==s2);
		s1.add();
		s2.add();
		System.out.println(s1.geyCount());
		ThreadSafeSingleton tss1=ThreadSafeSingleton.getInstance();
		ThreadSafeSingleton tss2=ThreadSafeSingleton.getInstance();
		System.out.println(tss1==tss2);
		System.out.println("系统中的单例===============");
		Runtime r1=Runtime.getRuntime();
		Runtime r2=Runtime.getRuntime();
		System.out.println(r1==r2);
		System.out.println("java虚拟机分配的内存："+r1.totalMemory());
		System.out.println("java虚拟机剩余的内存："+r2.freeMemory());
		try {
			r1.exec("\"C:\\Program Files (x86)\\UCBrowser\\Application\\UCBrowser.exe\"").waitFor();
		} catch (Exception e) {
           e.printStackTrace();
		}
	}
}
